Update Resource
Introduction
The following Assetic REST API endpoint may be used to update a resource.
-
PUT /api/v2/resource/{id}
-
{id} is the Assetic GUID of the resource.
-
If the GUID is unknown it can be obtained via the Assetic REST API GET /api/v2/resource. A filter on fields such as DisplayName or FirstName/Surname or Company may be used with the GET /api/v2/resource API. The article Get Resource describes this API in further detail.
Note: The PUT endpoint does not support partial updates, so the update payload must include all editable fields with either their current value or the intended new/modified value
Resource Fields
The following properties are relevant:
Field | Description | Type |
Id | The unique Assetic GUID identifying the resource. Must be included in the request body and the request URL | GUID |
DisplayName | The resource name that is displayed in the Assetic UI. If NULL the displayName a concatenation of the FirstName, Surname, and Company. | char(100) |
FirstName | First name of person | char(50) |
Surname | Family name of person | char(50) |
Company | Company. Not required unless both First Name and Surname are empty | char(100) |
Position | Role withing the company | String |
Status | "Active" or "Inactive" | String |
Types | An array of "Requestor Types". (See below) | Array of Object |
ExternalID | An external reference number | String |
Phone | Phone number | String |
Mobile | Mobile phone number | String |
Fax | Fax number | String |
Email address | String | |
AddressComment | An address string or comment about the address | String |
Requestor Type
Requestor type object has 2 properties 'Id' (Integer) and 'Type' (String). Only the "Type" may be used to set the Requestor type. The "Id' is ignored.
Id | Type |
2 | Team |
4 | Customer |
8 | Contractor |
16 | Employee |
32 | Company |
Sample Payload
The following payload is used to set the status of a resource to 'Inactive'
Request
https://[your_site].assetic.net/api/v2/resource/803384cb-1590-e611-946c-06edd62954d7
Request Body
{ "Id": "803384cb-1590-e611-946c-06edd62954d7", "DisplayName": "James Esson (Assetic)", "FirstName": "James", "Surname": "Esson", "Company": "Assetic", "Position": null, "Phone": "0400000000", "Mobile": null, "Fax": null, "Email": "jesson@assetic.com", "AddressComment": "Lvl 12, 257 Collins St, Melbourne VIC 3000, Australia", "ExternalID": null, "Status": "Inactive", "Types": [{"Type":"Employee"}] }
Response
{ "Id": "803384cb-1590-e611-946c-06edd62954d7", "DisplayName": "James Esson (Assetic)", "FirstName": "James", "Surname": "Esson", "Company": "Assetic", "Position": null, "Phone": "0400000000", "Mobile": null, "Fax": null, "Email": "jesson@assetic.com", "AddressComment": "Lvl 12, 257 Collins St, Melbourne VIC 3000, Australia", "ExternalID": null, "StatusId": 2, "Status": "Inactive", "Types": [ { "Id": 16, "Type": "Employee", "_links": [], "_embedded": null } ], "_links": [], "_embedded": null }